{% extends "WebMainSiteBundle:User:layout.html.twig" %}
{% set title = "任职学校管理" %}
{% block title %}
    {{ title }}
{% endblock %}

{% block user_main %}
    {% if join != 1 %}
        {% if apply is defined and apply.status != 1 and applySchool is defined %}
            {% set school = applySchool %}
            <h4 class="yahei">等待审核的学校</h4>
            <hr/>
            <hr class="invisible"/>
            <div class="row our-team">
                <div class="col-md-4">
                    <figure>
                        <img src="{{ asset(school.logo) }}" class="img-rounded" />
                        <figcaption>{{ school.name }}</figcaption>
                    </figure>
                </div>
                <div class="col-md-5">
                    <p style="text-indent: 2em;">
                        {{ school.intro }}
                    </p>
                    <hr class="invisible">
                </div>
                <div class="col-md-3">
                    <p class="button-full">
                        <a href="{{ path("WebTeacherDelApply",{ id : apply.id}) }}" class="btn btn-theme btn-danger">
                            <i class="fa fa-exclamation-triangle"></i> 取消申请
                        </a>
                    </p>
                    <p>
                        <b>审核状态:</b><br>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        [ {% if apply.status == 0 %}等待审核{% endif %}
                        {% if apply.status == 1 %}审核已通过{% endif %}
                        {% if apply.status == 2 %}审核被驳回{% endif %} ]
                    </p>
                    <p>
                        <b>审核意见:</b><br>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        {{ apply.reply ? apply.reply : "请耐心等待校方工作人员审核处理。" }}
                    </p>
                    <hr class="invisible">
                </div>
            </div>
        {% endif %}

        <h4 class="yahei">您尚未加入任何学校，请选择加入</h4>
        <hr/>
        <hr class="invisible"/>
        <div class="row our-team">
            {% for school in schools %}
                <div class="col-md-12">
                    <div class="col-md-5">
                        <figure>
                            <img src="{{ asset(school.logo) }}"  style="width: 100%;height: auto;" />
                            <figcaption>{{ school.name }}</figcaption>
                        </figure>
                    </div>
                    <div class="col-md-7">
                        <form action="{{ path("WebTeacherSetSchool" , { id : school.id }) }}">
                            <div class="row">
                                <p class="button-full">
                                    <button  class="btn btn-theme btn-danger" type="submit">
                                        <i class="fa fa-edit"></i> 加入此学校
                                    </button>
                                </p>
                                <div class="form-group">
                                    <textarea name="message" class="form-control" rows="3" placeholder="填写留言信息"></textarea>
                                </div>
                                <p>{{ school.intro }}</p>
                            </div>
                        </form>
                    </div>
                    {#<p class="button-full">#}
                    {#<a href="{{ path("WebTeacherSetSchool" , { id : school.id }) }}" class="btn btn-theme btn-green" data-content="23 Tutorials" data-placement="bottom">#}
                    {#<i class="fa fa-edit"></i> 加入此学校#}
                    {#</a>#}
                    {#</p>#}

                    <hr class="invisible">
                </div>
            {% endfor %}
        </div>
    {% else %}
        <h4 class="yahei">所在学校</h4>
        <hr/>
        <hr class="invisible"/>
        <div class="row our-team">
            <div class="col-md-4">
                <figure>
                    <img src="{{ asset(school.logo) }}" class="img-rounded" alt="Edward Willis" />
                    <figcaption>{{ school.name }}</figcaption>
                </figure>
            </div>
            <div class="col-md-5">
                <p style="text-indent: 2em;">
                    {{ school.intro }}
                </p>
                <hr class="invisible">
            </div>
            <div class="col-md-3">
                <p class="button-full">
                    <a href="{{ path("WebSchoolHome",{id:school.id}) }}" class="btn btn-theme btn-green">
                        <i class="fa fa-home"></i> 学校首页
                    </a>
                </p>
                <p class="button-full">
                    <a href="{{ path("WebCourseInfoAdd") }}" class="btn btn-theme btn-green">
                        <i class="fa fa-edit"></i> 发布课程
                    </a>
                </p>
                <p class="button-full">
                    <a href="{{ path("WebLeaveSchool") }}" class="btn btn-theme btn-danger" target="msg">
                        <i class="fa fa-exclamation-triangle"></i> 解除关系
                    </a>
                </p>
                <hr class="invisible">
            </div>
        </div>
    {% endif %}
{% endblock %}
{#{% block myCss %}#}

    {#<link href="{{ asset("bundles/systemadmin/css/ui-dialog.css") }}" rel="stylesheet" type="text/css" />#}
    {#<script type="text/javascript" charset="utf-8" src="{{ asset("bundles/systemadmin/js/jquery-1.11.2.min.js") }}"></script>#}
    {#<script type="text/javascript" charset="utf-8" src="{{ asset("bundles/systemadmin/js/dialog-plus-min.js")}}"></script>#}
{#{% endblock %}#}
